/*
*		Í¨ÓÃ»º³åÇø,¶¥²ã°ü
*/

#include <string>
#ifndef _CONSOLE
	#include <QSysInfo>
	#ifdef Q_OS_WIN32
		#include <allocators>
	#else
		#include <bits/allocator.h>
	#endif
#else 
	#include <allocators>
#endif

#include "CxType.h"

using std::string;

//Í¨ÓÃ»º³åÇø£¬Ä£°åÐÎÊ½hold×¡¸÷ÖÖ²ÎÊý
template<		typename _Type,
		template<	typename _Ty , typename _Ax = std::allocator<_Ty> > 
				class _StoreType >

class CxCommonBuffer
{
protected:
    //×î´óbufferÊýÁ¿
    size_t					m_maxbufsiz;
    //Ö÷Òªbuffer´æ´¢¶ÔÏó
    _StoreType< _Type >		m_buffer;
public:
	//¹¹ÔìÎö¹¹
	CxCommonBuffer(size_t  _bufsiz):m_maxbufsiz(_bufsiz)
	{
	}
	virtual		~CxCommonBuffer(){}

public:
	//Ö÷Òª½ø³ö²Ù×÷Ðéº¯Êý
	virtual		_Type		Pop()=0;
	virtual		void		Push(const _Type & )=0;
	
	//Ö÷Òª²Ù×÷Ðéº¯Êý
	virtual		void		Clear()=0;
	virtual		bool		IsEmpty()const=0;
	virtual		bool		IsFull()const=0;
	//·µ»ØbufferÀàÐÍ
	virtual		string		BufferType()const=0;
};
